package com.oig.sys.workflow.dto;

import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Schema
@Data
public class ListenerEventDto {

	@Schema(description = "id")
	private Integer id;

	@Schema(description = "监听对象id")
	private Integer objectId;

	@Schema(description = "监听事件名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,监听事件名称不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String listenerEventName;

	@Schema(description = "对应实体对象id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotNull(message = "参数错误,对应实体对象id不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private Integer listenerModuleId;
	@Schema(description = "对应实体对象名", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,对应实体对象名不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String listenerModuleName;
	@Schema(description = "监听表名", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,监听表名不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String listenerTableName;

	@Schema(description = "监听操作", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,监听操作不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String listenerEventOperation;
	@Schema(description = "单据id属性名", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
	@NotEmpty(message = "参数错误,单据id属性名不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String objectIdColumn;

	@Schema(description = "备注说明")
	private String remark;

}
